import {
  utilityListSelect,
  utilityUserMenuSelect,
  utilitybatchByUserId
} from '@/api/utilityTool/utilityTool'

const utilityTool = {
  actions: {
    // 查询定制后的菜单列表
    utilityListSelect({ commit }, args) {
      return new Promise((resolve, reject) => {
        utilityListSelect(args).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 查询有权限的菜单列表
    utilityUserMenuSelect({ commit }, args) {
      return new Promise((resolve, reject) => {
        utilityUserMenuSelect(args).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 批量新增列表
    utilitybatchByUserId({ commit }, args) {
      return new Promise((resolve, reject) => {
        utilitybatchByUserId(args).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default utilityTool
